From: Florian Müllner Date: Sun, 4 Aug 2019 23:02:38 +0000 (+0200) Subject: pageIndicators: Defer IN animation until redraw X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~839^2^2~58 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=870dd84a50553b8d04fb4b25fa2446c2c93f60ca;p=gnome-shell.git pageIndicators: Defer IN animation until redraw Unlike Tweener, which doesn't know or care about actor state, Clutter will skip implicit animations on actors that aren't mapped. This makes sense of course, but it will break the page indicator animation we do on map: When we get notified about the container being mapped, the individual indicators (which are the actors being animated) are still unmapped. Resolve this by deferring the animation to a LaterFunc. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22 --- diff --git a/js/ui/pageIndicators.js b/js/ui/pageIndicators.js index 05a535e75..c28e001e8 100644 --- a/js/ui/pageIndicators.js +++ b/js/ui/pageIndicators.js @@ -1,7 +1,7 @@ // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- /* exported PageIndicators, AnimatedPageIndicators */ -const { Clutter, GObject, St } = imports.gi; +const { Clutter, GLib, GObject, Meta, St } = imports.gi; const Tweener = imports.ui.tweener; const { ANIMATION_TIME_OUT, ANIMATION_MAX_DELAY_OUT_FOR_ITEM, AnimationDirection } = imports.ui.iconGrid; @@ -97,7 +97,15 @@ class AnimatedPageIndicators extends PageIndicators { super._init(true); this.connect('notify::mapped', () => { - this.animateIndicators(AnimationDirection.IN); + if (!this.mapped) + return; + + // Implicit animations are skipped for unmapped actors, and our + // children aren't mapped yet, so defer to a later handler + Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { + this.animateIndicators(AnimationDirection.IN); + return GLib.SOURCE_REMOVE; + }); }); }